package com.ecoolex.ying.space.entity;

import com.ecoolex.framework.common.annotation.Description;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import org.springframework.lang.NonNull;

/**
 *
 *   用户作品购物<br>
 *<br>
 * 数据表： user_works_shopping
 *
 */
@Description({"用户作品购物"})
public class UserWorksShopping implements Serializable {
    /**
     *
     *   主键    <br>
     *<br>
     * 字段名： user_works_shopping.Id
     */
    @Description({"主键", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer id;

    /**
     *
     *   作者id    <br>
     *<br>
     * 字段名： user_works_shopping.UserId
     */
    @Description({"作者id", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer userId;

    /**
     *
     *   作品Id    <br>
     *<br>
     * 字段名： user_works_shopping.WorksId
     */
    @Description({"作品Id", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer worksId;

    /**
     *
     *   存储资源Id    <br>
     *<br>
     * 字段名： user_works_shopping.StorageId
     */
    @Description({"存储资源Id", "不能为空", "数据长度: 100"})
    @NonNull
    private String storageId;

    /**
     *
     *   排序    <br>
     *<br>
     * 字段名： user_works_shopping.Ordered
     */
    @Description({"排序", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer ordered;

    /**
     *
     *   1: 商品; 2:套餐; 3: 外链; 4文字    <br>
     *<br>
     * 字段名： user_works_shopping.Type
     */
    @Description({"1: 商品; 2:套餐; 3: 外链; 4文字", "不能为空", "数据长度: 5"})
    @NonNull
    private Integer type;

    /**
     *
     *   标签    <br>
     *<br>
     * 字段名： user_works_shopping.Label
     */
    @Description({"标签", "数据长度: 1000"})
    private String label;

    /**
     *
     *   链接名称    <br>
     *<br>
     * 字段名： user_works_shopping.LinkName
     */
    @Description({"链接名称", "数据长度: 255"})
    private String linkName;

    /**
     *
     *   链接    <br>
     *<br>
     * 字段名： user_works_shopping.Link
     */
    @Description({"链接", "数据长度: 255"})
    private String link;

    /**
     *
     *   链接价格    <br>
     *<br>
     * 字段名： user_works_shopping.LinkPrice
     */
    @Description({"链接价格", "数据长度: 10"})
    private BigDecimal linkPrice;

    /**
     *
     *   商品Id    <br>
     *<br>
     * 字段名： user_works_shopping.GoodsId
     */
    @Description({"商品Id", "数据长度: 10"})
    private Integer goodsId;

    /**
     *
     *   套餐Id    <br>
     *<br>
     * 字段名： user_works_shopping.PackagedId
     */
    @Description({"套餐Id", "数据长度: 10"})
    private Integer packagedId;

    public static final Boolean NOT_DELETED = Deleted.NOT_DELETED.value();

    public static final Boolean IS_DELETED = Deleted.IS_DELETED.value();

    /**
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： user_works_shopping.Deleted
     */
    @Description({"逻辑删除", "不能为空", "数据长度: 1"})
    @NonNull
    private Boolean deleted;

    /**
     *
     *   创建用户    <br>
     *<br>
     * 字段名： user_works_shopping.CreateUser
     */
    @Description({"创建用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String createUser;

    /**
     *
     *   创建时间    <br>
     *<br>
     * 字段名： user_works_shopping.CreateTime
     */
    @Description({"创建时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date createTime;

    /**
     *
     *   修改用户    <br>
     *<br>
     * 字段名： user_works_shopping.UpdateUser
     */
    @Description({"修改用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String updateUser;

    /**
     *
     *   修改时间    <br>
     *<br>
     * 字段名： user_works_shopping.UpdateTime
     */
    @Description({"修改时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    /**
     * 获取参数<br><br>
     *
     *   主键    <br>
     *<br>
     * 字段名： user_works_shopping.Id
     */
    public Integer getId() {
        return id;
    }

    /**
     * 设置参数<br><br>
     *
     *   主键<br>
     *<br>
     * 字段名： user_works_shopping.Id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取参数<br><br>
     *
     *   作者id    <br>
     *<br>
     * 字段名： user_works_shopping.UserId
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * 设置参数<br><br>
     *
     *   作者id<br>
     *<br>
     * 字段名： user_works_shopping.UserId
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * 获取参数<br><br>
     *
     *   作品Id    <br>
     *<br>
     * 字段名： user_works_shopping.WorksId
     */
    public Integer getWorksId() {
        return worksId;
    }

    /**
     * 设置参数<br><br>
     *
     *   作品Id<br>
     *<br>
     * 字段名： user_works_shopping.WorksId
     */
    public void setWorksId(Integer worksId) {
        this.worksId = worksId;
    }

    /**
     * 获取参数<br><br>
     *
     *   存储资源Id    <br>
     *<br>
     * 字段名： user_works_shopping.StorageId
     */
    public String getStorageId() {
        return storageId;
    }

    /**
     * 设置参数<br><br>
     *
     *   存储资源Id<br>
     *<br>
     * 字段名： user_works_shopping.StorageId
     */
    public void setStorageId(String storageId) {
        this.storageId = storageId == null ? null : storageId.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   排序    <br>
     *<br>
     * 字段名： user_works_shopping.Ordered
     */
    public Integer getOrdered() {
        return ordered;
    }

    /**
     * 设置参数<br><br>
     *
     *   排序<br>
     *<br>
     * 字段名： user_works_shopping.Ordered
     */
    public void setOrdered(Integer ordered) {
        this.ordered = ordered;
    }

    /**
     * 获取参数<br><br>
     *
     *   1: 商品; 2:套餐; 3: 外链; 4文字    <br>
     *<br>
     * 字段名： user_works_shopping.Type
     */
    public Integer getType() {
        return type;
    }

    /**
     * 设置参数<br><br>
     *
     *   1: 商品; 2:套餐; 3: 外链; 4文字<br>
     *<br>
     * 字段名： user_works_shopping.Type
     */
    public void setType(Integer type) {
        this.type = type;
    }

    /**
     * 获取参数<br><br>
     *
     *   标签    <br>
     *<br>
     * 字段名： user_works_shopping.Label
     */
    public String getLabel() {
        return label;
    }

    /**
     * 设置参数<br><br>
     *
     *   标签<br>
     *<br>
     * 字段名： user_works_shopping.Label
     */
    public void setLabel(String label) {
        this.label = label == null ? null : label.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   链接名称    <br>
     *<br>
     * 字段名： user_works_shopping.LinkName
     */
    public String getLinkName() {
        return linkName;
    }

    /**
     * 设置参数<br><br>
     *
     *   链接名称<br>
     *<br>
     * 字段名： user_works_shopping.LinkName
     */
    public void setLinkName(String linkName) {
        this.linkName = linkName == null ? null : linkName.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   链接    <br>
     *<br>
     * 字段名： user_works_shopping.Link
     */
    public String getLink() {
        return link;
    }

    /**
     * 设置参数<br><br>
     *
     *   链接<br>
     *<br>
     * 字段名： user_works_shopping.Link
     */
    public void setLink(String link) {
        this.link = link == null ? null : link.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   链接价格    <br>
     *<br>
     * 字段名： user_works_shopping.LinkPrice
     */
    public BigDecimal getLinkPrice() {
        return linkPrice;
    }

    /**
     * 设置参数<br><br>
     *
     *   链接价格<br>
     *<br>
     * 字段名： user_works_shopping.LinkPrice
     */
    public void setLinkPrice(BigDecimal linkPrice) {
        this.linkPrice = linkPrice;
    }

    /**
     * 获取参数<br><br>
     *
     *   商品Id    <br>
     *<br>
     * 字段名： user_works_shopping.GoodsId
     */
    public Integer getGoodsId() {
        return goodsId;
    }

    /**
     * 设置参数<br><br>
     *
     *   商品Id<br>
     *<br>
     * 字段名： user_works_shopping.GoodsId
     */
    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    /**
     * 获取参数<br><br>
     *
     *   套餐Id    <br>
     *<br>
     * 字段名： user_works_shopping.PackagedId
     */
    public Integer getPackagedId() {
        return packagedId;
    }

    /**
     * 设置参数<br><br>
     *
     *   套餐Id<br>
     *<br>
     * 字段名： user_works_shopping.PackagedId
     */
    public void setPackagedId(Integer packagedId) {
        this.packagedId = packagedId;
    }

    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * 获取参数<br><br>
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： user_works_shopping.Deleted
     */
    public Boolean getDeleted() {
        return deleted;
    }

    /**
     * 设置参数<br><br>
     *
     *   逻辑删除<br>
     *<br>
     * 字段名： user_works_shopping.Deleted
     */
    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    /**
     * 获取参数<br><br>
     *
     *   创建用户    <br>
     *<br>
     * 字段名： user_works_shopping.CreateUser
     */
    public String getCreateUser() {
        return createUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建用户<br>
     *<br>
     * 字段名： user_works_shopping.CreateUser
     */
    public void setCreateUser(String createUser) {
        this.createUser = createUser == null ? null : createUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   创建时间    <br>
     *<br>
     * 字段名： user_works_shopping.CreateTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建时间<br>
     *<br>
     * 字段名： user_works_shopping.CreateTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 获取参数<br><br>
     *
     *   修改用户    <br>
     *<br>
     * 字段名： user_works_shopping.UpdateUser
     */
    public String getUpdateUser() {
        return updateUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改用户<br>
     *<br>
     * 字段名： user_works_shopping.UpdateUser
     */
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser == null ? null : updateUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   修改时间    <br>
     *<br>
     * 字段名： user_works_shopping.UpdateTime
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改时间<br>
     *<br>
     * 字段名： user_works_shopping.UpdateTime
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public enum Deleted {
        NOT_DELETED(new Boolean("false"), "未删除"),
        IS_DELETED(new Boolean("true"), "已删除");

        private final Boolean value;

        private final String name;

        Deleted(Boolean value, String name) {
            this.value = value;
            this.name = name;
        }

        public Boolean getValue() {
            return this.value;
        }

        public Boolean value() {
            return this.value;
        }

        public String getName() {
            return this.name;
        }
    }

    public enum Column {
        id("Id", "id", "INTEGER", false),
        userId("UserId", "userId", "INTEGER", false),
        worksId("WorksId", "worksId", "INTEGER", false),
        storageId("StorageId", "storageId", "VARCHAR", false),
        ordered("Ordered", "ordered", "INTEGER", false),
        type("Type", "type", "INTEGER", true),
        label("Label", "label", "VARCHAR", true),
        linkName("LinkName", "linkName", "VARCHAR", false),
        link("Link", "link", "VARCHAR", false),
        linkPrice("LinkPrice", "linkPrice", "DECIMAL", false),
        goodsId("GoodsId", "goodsId", "INTEGER", false),
        packagedId("PackagedId", "packagedId", "INTEGER", false),
        deleted("Deleted", "deleted", "BIT", false),
        createUser("CreateUser", "createUser", "VARCHAR", true),
        createTime("CreateTime", "createTime", "TIMESTAMP", false),
        updateUser("UpdateUser", "updateUser", "VARCHAR", false),
        updateTime("UpdateTime", "updateTime", "TIMESTAMP", false);

        private static final String BEGINNING_DELIMITER = "`";

        private static final String ENDING_DELIMITER = "`";

        private final String column;

        private final boolean isColumnNameDelimited;

        private final String javaProperty;

        private final String jdbcType;

        public String value() {
            return this.column;
        }

        public String getValue() {
            return this.column;
        }

        public String getJavaProperty() {
            return this.javaProperty;
        }

        public String getJdbcType() {
            return this.jdbcType;
        }

        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }
    }
}